#ifndef MOTO_CONTROL_H
#define MOTO_CONTROL_H

#include "gd32f10x_libopt.h"

/* moto speed set: 1~999
 * fast: 999
 * middle: 500
 * slow: 300
 */
#define FAST 990
#define MIDDLE 500
#define SLOW 300

/* typedef num:
 * Convert the underlying enumeration into our own.
 */
enum{
    GROUP1_CHANNEL1,
    GROUP1_CHANNEL2,
    GROUP2_CHANNEL1,
    GROUP2_CHANNEL2,

    GROUP1_ALL,
    GROUP2_ALL,
};

void group1_moto_set(uint16_t channel, uint16_t duty);
void group2_moto_set(uint16_t channel, uint16_t duty);
void forward_set(uint16_t duty);
void recoil_set(uint16_t duty);
void turn_left_set(uint16_t duty);
void turn_right_set(uint16_t duty);
void stop_set(void);

#endif
